using System;

namespace BGM.Domain.DTO
{
   public class BloodGlucoseReading: Reading,IComparable<BloodGlucoseReading>
    {
        protected int flag;
        protected int unknown;
        protected int sequenceNumber;
      
       public BloodGlucoseReading()
       {

       }
     
       public BloodGlucoseReading(DateTime timeStamp, int flag, int value, int unknown, int sequenceNumber)
        {
            this.timeStamp = timeStamp;
            this.flag = flag;
            this.value = value;
            this.unknown = unknown;
            this.sequenceNumber = sequenceNumber;
        }

   

       public double ValueInMmolL
       {
           get { return this.value / (double)18; }
       }
       public override string ToString()
       {
           return base.TimeStamp + " " +this.GetType().Name + " " + ValueInMmolL.ToString("##0.00");
       }

       #region IComparable<BloodGlucoseReading> Members

       public int CompareTo(BloodGlucoseReading other)
       {
           return this.timeStamp.CompareTo(other.TimeStamp);
       }

       #endregion




       public int Flag
       {
           get { return flag; }
           set { flag = value; }
       }
       public int Unknown
       {
           get { return unknown; }
           set { unknown = value; }
       }
       public int SequenceNumber
       {
           get { return sequenceNumber; }
           set { sequenceNumber = value; }
       }

   }
}
